package com.ctg.itrdc.imageconsole.data.dao;

import java.util.List;

import com.ctg.itrdc.imageconsole.data.dto.DockerImageFileDTO;
import com.ctg.itrdc.imageconsole.data.entity.DockerImage;
import com.ctg.itrdc.paspsdk.common.entity.PageInfo;
import com.ctg.itrdc.paspsdk.data.dao.IBaseCacheDao;
import com.ctg.itrdc.paspsdk.data.dao.IBaseDao;

/**
 * 
 * @Description 
 * @author <a href="mailto:18070514058@163.com">Piao.Wu</a>
 * @Data 2016年5月18日
 * @Version 1.0.0
 */
public interface IDockerImageDao extends IBaseCacheDao, IBaseDao  {
	
	PageInfo<DockerImageFileDTO> jdbcFindPageInfo(Long userId, String imageName,String imageType, int currentPage, int perPageNum);


	DockerImage findDockerImageFile(Long createUserId, String tenantCode,String appName,String[] statuss);
	
	DockerImage findDockerImageFileById(Long imageFileId);
	
	List<DockerImage> findByIdStr(String idStr);

	/**
	 * 找出某镜像分组所包含的镜像
	 * @param groupId
	 * @param dockerImageFileDTO
	 * @param currentPage
	 * @param perPageNum
	 * @return
	 */
	PageInfo<DockerImageFileDTO> queryImageFileByGroupId(Long groupId, DockerImageFileDTO dockerImageFileDTO, 
			Integer currentPage, Integer perPageNum);
	
	/**
	 * 找出某镜像分组可添加的镜像列表
	 * @param groupId
	 * @param dockerImageFileDTO
	 * @param currentPage
	 * @param perPageNum
	 * @return
	 */
	PageInfo<DockerImageFileDTO> canSelectImageFileByGroupId(Long groupId, DockerImageFileDTO dockerImageFileDTO,
			Integer currentPage, Integer perPageNum);

	// follows is added by pshizh 

	DockerImage selectById(Long id);


	DockerImage selectByAppName(String appName);


	List<DockerImage> selectByCreateUserId(Long sysUserId);


	List<DockerImage> selectByNtype(String ntype);	

	
	/*// appName is for filtering
	PageInfo<DockerImageFileDTO> selectByNtypeAndFilterByAppName(String appName, String nType, Integer currentPage,
			Integer perPageNum);*/


	PageInfo<DockerImageFileDTO> selectByCreateUserIdAndFilterByAppNameInPageInfo(Long userId, String imageName,
			Integer currentPage, Integer perPageNum);


	PageInfo<DockerImageFileDTO> selectByCreateUserIdAndNtypeAndFilterByAppNameInPageInfo(Long createUserId, String ntype,
			String appName, Integer currentPage, Integer perPageNum);
	
}
